﻿using CSM_SQL.DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSM_SQL.BLL
{
    public class CustomerBLL
    {
        private CustomerDAL _customerDal;
        public CustomerDAL CustomerDal
        {
            get
            {
                if (_customerDal == null)
                    _customerDal = new CustomerDAL();
                return _customerDal;
            }
        }

        public Boolean Insert(Customer c)
        {
            return CustomerDal.Insert(c);
        }

        public List<Customer> All()
        {
            return CustomerDal.All();
        }

        public Boolean ChangeState(int id, int state)
        {
            return CustomerDal.ChangeState(id, state);
        }

        public List<Cus_Ord> GetOrder(int C_ID)
        {
            return CustomerDal.GetOrder(C_ID);
        }

        public List<OrderMes> GetTasks(int id)
        {
            return CustomerDal.GetTasks(id);
        }

        public List<CartMes> GetCart(int id)
        {
            return CustomerDal.GetCart(id);
        }

        public bool DelCart(int  id)
        {
            return CustomerDal.DelCart(id);
        }

        public bool ClearCart(int id)
        {
            return CustomerDal.ClearCart(id);
        }

        public void ChangeCart(int id,int num)
        {
            CustomerDal.ChangeCart(id,num);
        }

        public Boolean Pay(int[] ids)
        {
            return CustomerDal.Pay(ids);
        }

        public Boolean Apply(int O_id, int T_id)
        {
            return CustomerDal.Apply(O_id, T_id);
        }

        public void Send(int id)
        {
            CustomerDal.Send(id);
        }

        public int Pick(int C_ID,int G_ID)
        {
            return CustomerDal.Pick(C_ID, G_ID);
        }

        public List<OrderMes> GetHistory(int C_ID)
        {
            return CustomerDal.GetHistory(C_ID);
        }

        public void Sign(int id)
        {
            CustomerDal.Sign(id);
        }

        public Boolean PostAssess(Assess a)
        {
            return CustomerDal.PostAssess(a);
        }

        public Boolean Edit(Customer c)
        {
            return CustomerDal.Edit(c);
        }

        public Boolean ChangePwd(Customer c)
        {
            return CustomerDal.ChangePwd(c);
        }
    }
}
